const propsMap = new Map([
  ['pickUid', {label: '拣货单UID', prop: 'pickUid', width: 120}],
  ['picker', {label: '拣货人', prop: 'picker', width: 120}],
  ['pickTime', {label: '拣货时间', prop: 'pickTime', width: 180}],
  ['cardImg', {label: '卡牌图片', prop: 'cardImg', width: 90, slots: {default: 'cardImg'}}],
  ['orderOutNo', {label: '销售订单UID', prop: 'orderOutNo', width: 120}],
  ['orderType', {label: '订单类型', prop: 'orderType', width: 120, slots: {default: 'orderType'}}],
  ['cardId', {label: '卡牌UID', prop: 'cardId', width: 180}],
  ['name', {label: '标题', prop: 'name'}],
  ['rating', {label: '类型', prop: 'rating', width: 80}],
  ['sendType', {label: '售卖模式', prop: 'sendType', width: 90, slots: {default: 'sendType'}}],
  ['cardsId', {label: '合集ID', prop: 'cardsId', width: 80}],
  ['userNickname', {label: '卖家', prop: 'userNickname', width: 120}],
  ['userWmsId', {label: '私人仓货架ID', prop: 'userWmsId', width: 120}],
  ['createTime', {label: '创建时间', prop: 'createTime', width: 180}],
  ['cardStatus', {label: '订单状态', prop: 'cardStatus', width: 120, slots: {default: 'cardStatus'}}],
  ['sendTime', {label: '发货时间', prop: 'sendTime', width: 180}],
  ['logisticsCompany', {label: '发货物流公司', prop: 'logisticsCompany', width: 140}],
  ['trackingNo', {label: '发货物流单号', prop: 'trackingNo', width: 140}],
  ['sendName', {label: '发货人', prop: 'sendName', width: 120}],
  ['checked', {label: '操作', prop: 'checked', width: 70, slots: {default: 'checked'}, fixed: 'right'}],
  ['viewerDetail', {label: '操作', prop: 'viewerDetail', width: 90, slots: {default: 'viewerDetail'}, fixed: 'right'}]
])

// 获取根据prop列配置
const getColumns = (props) => props.map(prop => propsMap.get(prop))

const columnsMap = new Map([
  // 待拣货列表
  [1, getColumns(['cardImg', 'orderOutNo', 'orderType', 'cardId', 'name', 'rating', 'sendType', 'cardsId', 'userNickname', 'userWmsId', 'createTime', 'cardStatus', 'checked'])],
  // 待确认出仓
  [2, getColumns(['pickUid', 'picker', 'pickTime', 'cardImg', 'orderOutNo', 'orderType', 'cardId', 'name', 'rating', 'sendType', 'cardsId', 'userNickname', 'userWmsId', 'createTime', 'cardStatus', 'checked'])],
  // 待发货
  [3, getColumns(['pickUid', 'picker', 'pickTime', 'cardImg', 'orderOutNo', 'orderType', 'cardId', 'name', 'rating', 'sendType', 'cardsId', 'userNickname', 'userWmsId', 'createTime', 'cardStatus', 'checked'])],
  // 已发货
  [4, getColumns(['cardImg', 'orderOutNo', 'orderType', 'cardId', 'name', 'rating', 'sendType', 'cardsId', 'userNickname', 'userWmsId', 'createTime', 'cardStatus', 'sendTime', 'logisticsCompany', 'trackingNo', 'sendName', 'viewerDetail'])]
])


/**
 * 配置说明
 * tableColumns：表格列配置
 * ElCheckbox_checkAll_open：全选显示状态
 * ElButton_batchPicking_open：批量拣货出仓按钮显示状态
 * ElButton_confirmPicking_open：确认已拣货出仓按钮显示状态
 * ElButton_batchSend_open：批量发货按钮显示状态
 * OrderLogisticsDialog_writeSend_open：填写订单发货物流信息显示状态
 */
export default new Map([
  [1, {
    tableColumns: columnsMap.get(1),
    ElCheckbox_checkAll_open: true,
    ElButton_batchPicking_open: true
  }],
  [2, {
    tableColumns: columnsMap.get(2),
    ElCheckbox_checkAll_open: true,
    ElButton_confirmPicking_open: true
  }],
  [3, {
    tableColumns: columnsMap.get(3),
    ElCheckbox_checkAll_open: true,
    ElButton_batchSend_open: true,
    OrderLogisticsDialog_writeSend_open: true
  }],
  [4, {
    tableColumns: columnsMap.get(4)
  }]
])
